import request from '@/utils/request'

/**
 * 评论服务
 * @type {{verifyComment: (function(*=, *=): *), replyComment: (function(*=): *), delComment: (function(*): *), listComment: (function(*): *)}}
 */
export const CommentService = {
  // 评论列表
  listComment: function(query) { return request({ method: 'get', url: '/manage/product/comment/list.do', params: { ...query }}) },
  // 删除评论
  delComment: function(id) { return request({ method: 'post', url: '/manage/product/comment/delete.do', data: [id] }) },
  // 回复评论
  replyComment: function(data) { return request({ method: 'post', url: '/manage/product/comment/reply.do', data: data }) },
  // 评论审核
  verifyComment: function(commentId, status) { return request({ method: 'get', url: '/manage/product/comment/verify.do', params: { commentId: commentId, status: status }}) }
}

export const NotifyService = {
  // 通知撤销
  editNotifyRevoke: function(notifyId, revoke) { return request({ method: 'get', url: '/manage/notify/revoke.do', params: { notifyId: notifyId, revoke: revoke }}) },
  // 删除通知
  delNotify: function(id) { return request({ method: 'post', url: '/manage/notify/delete.do', data: [id] }) },
  // 通知列表
  listNotify: function(query) { return request({ method: 'get', url: '/manage/notify/list.do', params: { ...query }}) },
  // 发布通知
  addNotify: function(data) { return request({ method: 'post', url: '/manage/notify/add.do', data: data }) },
  // 编辑通知
  editNotify: function(data) { return request({ method: 'post', url: '/manage/notify/edit.do', data: data }) }
}
